<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link href="../../assets/lib/layui/css/layui.css" rel="stylesheet"/>
    <link href="../../assets/lib/winui/css/winui.css" rel="stylesheet"/>
    <style type="text/css">
        .ui-page {
            background: white;
        }

        .ui-header {
            background-color: #5693C0 ! important;
            text-shadow: 0 1px 0 #3D586C ! important;
            padding-bottom: 5px;
        }

        .ui-content {
            padding: 0px 1em;
        }

        .ui-footer {
            color: #3D586C ! important;
            background: none ! important;
        }

        .ui-header, .ui-footer {
            border: none ! important;
        }

        .starRating {
            font-size: 26px;
        }

        .starRating .fa {
            cursor: pointer;
        }

        .starRating .fa-star {
            color: #3388CC;
        }

        .subbtn {
            opacity: 1 ! important;
            color: white;
        }

        .quTitleNum {
            /* position: absolute; */

        }

        .quTitleText {
            /* text-indent: 2em; */

        }

        #dwSurveyNote {
            padding-top: 0px;
        }

        .m_quOrderByUi {
            margin: 5px 0 5px 0;
            padding: 0;
            border: 1px solid #d5d5d5;
            border-radius: 3px;
        }

        .m_quOrderByUi li {
            border-color: #fff;
            font-size: 16px;
            min-height: 41px;
            position: relative;
            padding-right: 45px !important;
            border-bottom: 1px solid #EBEBEB !important;
        }

        .m_orderby_num {
            position: absolute;
            right: 10px;
            top: 55%;
            margin-top: -15px;
            min-width: 26px;
            height: 26px;
            background: #85C8FF;
            color: #fff;
            text-align: center;
            line-height: 26px;
            border-radius: 15px;
            z-index: 100;
            display: none;
        }

        .m_orderby_sel {
            position: absolute;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            opacity: 0;
            font-size: 30px;
            z-index: 9999;
            background-color: rgb(248, 248, 248);
            border: 1px solid rgb(166, 166, 166);
            border-image-source: initial;
            border-image-slice: initial;
            border-image-width: initial;
            border-image-outset: initial;
            border-image-repeat: initial;
            display: inline-block;
        }

        #wrap {
            overflow-x: hidden;
            margin: 0px 5px;
        }

        #dwSurveyName {
            width: auto;
        }

        #dwSurveyNoteEdit {
            width: auto;
            padding-right: 10px;
        }

        .surveyQuItem .surveyQuItemContent {
            width: calc(100% - 20px);
        }

        .surveyQuItem .surveyQuItemContent .quCoTitle .quCoTitleEdit {
            width: calc(100% - 45px);
        }

        table.quCoChenTable {
            width: auto;
        }

        table.quCoChenTable tr td {
            min-width: 80px;
        }

        @media screen and (max-width: 960px) {
            /* 手机端CSS代码 */
            #dw_body_content {
                width: 100%;
            }
        }

        @media screen and (min-width: 960px) {
            /* 电脑端CSS代码 */
            #dw_body_content {
                width: 60%;
            }
        }

        #dwSurveyQuContentAppUl {
            padding-bottom: 50px;
        }

        .detail-show {

        }

        .number-show {
            width: 25px;
            height: 25px;
            border-radius: 12px;
            background-color: burlywood;
            color: white;
            float: right;
            margin-top: 5px;
            margin-right: 5px;
            text-align: center;
            line-height: 25px;
        }

        .fraction {
            font-size: 13px;
            color: gray;
            white-space: nowrap;
        }

        .quKnowledgeInfoList {
            font-size: 13px;
            color: #429CE3;
            white-space: nowrap;
        }

        .has-fraction {
            font-size: 13px;
            color: blue;
            white-space: nowrap;
        }

        .pg {
            color: #FF0000 !important;
        }

        .kx {
            color: #1AAD19 !important;
        }
    </style>
</head>

<body>
<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">试卷信息</li>
        <li>题目预览</li>
        <li>答卷情况</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form" action="" id="showForm" autocomplete="off">

            </form>
        </div>
        <div class="layui-tab-item" style="background-color: RGB(232,233,235);">
            <form class="layui-form" action="" id="examShowForm" autocomplete="off">
                <div id="wrap">

                </div>
                <div class="footer-copyright footer-pb" style="color: gray;padding-bottom: 5px;">
                    源码地址:
                    <a href="https://gitee.com/doc_wei01/skyeye" style="text-decoration: none;color: gray;">skyeye</a>&nbsp;
                </div>
            </form>
        </div>
        <div class="layui-tab-item">
            <table id="messageTable" lay-filter="messageTable"></table>
        </div>
    </div>
</div>

<!-- 试卷信息 -->
<script type="text/x-handlebars-template" id="examMationTemplate">
    <div class="layui-form-item layui-col-xs12">
        <label class="layui-form-label">试卷名称：</label>
        <div class="layui-input-block ver-center">
            {{surveyName}}
        </div>
    </div>
    <!--	        <div class="layui-form-item layui-col-xs12">-->
    <!--	            <label class="layui-form-label">试卷语：</label>-->
    <!--	            <div class="layui-input-block ver-center">-->
    <!--                	{{surveyNote}}-->
    <!--                </div>-->
    <!--	        </div>-->
    <div class="layui-form-item layui-col-xs12">
        <label class="layui-form-label">所属学校：</label>
        <div class="layui-input-block ver-center">
            {{schoolMation.name}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">所属院系：</label>
        <div class="layui-input-block ver-center">
            {{facultyMation.name}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">开始时间：</label>
        <div class="layui-input-block ver-center">
            {{realStartTime}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">结束时间：</label>
        <div class="layui-input-block ver-center">
            {{realEndTime}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">所属专业：</label>
        <div class="layui-input-block ver-center">
            {{majorMation.name}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">考试科目：</label>
        <div class="layui-input-block ver-center">
            {{subjectMation.name}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs12">
        <label class="layui-form-label">考试班级：</label>
        <div class="layui-input-block ver-center">
            {{formatClassNames classesMation}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">学期：</label>
        <div class="layui-input-block ver-center">
            {{semesterMation.name}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs12">
        <label class="layui-form-label">考试结果：</label>
        {{#compare viewAnswer 1}}
        <div class="layui-input-block ver-center">
            公开
        </div>
        {{/compare}}
        {{#compare viewAnswer 0}}
        <div class="layui-input-block ver-center">
            不公开
        </div>
        {{/compare}}
    </div>
    <div class="layui-form-item layui-col-xs12">
        <label class="layui-form-label">其他阅卷人：</label>
        <div class="layui-input-block ver-center" id="markPeople">
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-block ver-center">
            {{#compare surveyState 0}}
            <span class="layui-badge layui-bg-blue">设计</span>
            {{/compare}}
            {{#compare surveyState 1}}
            <span class="layui-badge layui-bg-green">执行中</span>
            {{/compare}}
            {{#compare surveyState 2}}
            <span class="layui-badge layui-bg-gray">结束</span>
            {{/compare}}

        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">满分值：</label>
        <div class="layui-input-block ver-center">
            {{fraction}}
        </div>
    </div>
    <div class="layui-form-item layui-col-xs6">
        <label class="layui-form-label">创建时间：</label>
        <div class="layui-input-block ver-center">
            {{createTime}}
        </div>
    </div>
</script>

<!-- 1单选题radio -->
<script type="text/x-handlebars-template" id="radioTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                {{#if hv}}
                {{#compare1 hv '3'}}
                <table class='tableQuColItem'>
                    {{#each radioTd}}
                    <tr>
                        {{#cellCount001 cellCount}}{{/cellCount001}}
                    </tr>
                    {{/each}}
                    <tr>
                </table>
                {{else}}
                {{#if hv}}
                {{#compare1 hv '1'}}
                <ul class="transverse">
                    {{#each radioTd}}
                    <li class="quCoItemUlLi">
                        <div class="dwQuOptionItemContent">
                            <input type="radio" name="radioName{{../id}}" {{isDefaultAnswer}} disabled=""/>
                            <label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
                            <input type='text' class='inputSytle_1'
                                   style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}"
                                   name="text_qu_{{quType}}_{{quId}}_{{id}}"/>
                        </div>
                    </li>
                    {{/each}}
                </ul>
                {{else}}
                <ul>
                    {{#each radioTd}}
                    <li class="quCoItemUlLi">
                        <div class="dwQuOptionItemContent">
                            <input type="radio" name="radioName{{../id}}" {{isDefaultAnswer}} disabled=""/>
                            <label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
                            <input type='text' class='inputSytle_1'
                                   style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}"
                                   name="text_qu_{{quType}}_{{quId}}_{{id}}"/>
                        </div>
                    </li>
                    {{/each}}
                </ul>
                {{/compare1}}
                {{/if}}
                {{/compare1}}
                {{/if}}
            </div>
        </div>
    </div>
</script>

<!-- 2多选题checkbox -->
<script type="text/x-handlebars-template" id="checkBoxTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                {{#if hv}}
                {{#compare1 hv '3'}}
                <table class='tableQuColItem'>
                    {{#each checkboxTd}}
                    <tr>
                        {{#cellCount002 cellCount}}{{/cellCount002}}
                    </tr>
                    {{/each}}
                </table>
                {{else}}
                {{#if hv}}
                {{#compare1 hv '1'}}
                <ul class="transverse">
                    {{#each checkboxTd}}
                    <li class="quCoItemUlLi">
                        <div class="dwQuOptionItemContent">
                            <input type="checkbox" name="checkBoxName{{../id}}" {{isDefaultAnswer}} disabled=""/>
                            <label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
                            <input type='text' class='inputSytle_1'
                                   style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}"
                                   name="text_tag_qu_{{quType}}_{{quId}}_{{id}}"/>
                        </div>
                    </li>
                    {{/each}}
                </ul>
                {{else}}
                <ul>
                    {{#each checkboxTd}}
                    <li class="quCoItemUlLi">
                        <div class="dwQuOptionItemContent">
                            <input type="checkbox" name="checkBoxName{{../id}}" {{isDefaultAnswer}} disabled=""/>
                            <label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
                            <input type='text' class='inputSytle_1'
                                   style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}"
                                   name="text_tag_qu_{{quType}}_{{quId}}_{{id}}"/>
                        </div>
                    </li>
                    {{/each}}
                </ul>
                {{/compare1}}
                {{/if}}
                {{/compare1}}
                {{/if}}
            </div>
        </div>
    </div>
</script>

<!-- 3填空题fillblank -->
<script type="text/x-handlebars-template" id="fillblankTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <ul>
                    <li class="quCoItemUlLi">
                        <div class="quFillblankItem">
                            {{#if answerInputRow}}
                            {{#compare1 checkType '8'}}
                            <input type="text" name="qu_{{quType}}_{{id}}"
                                   style="width: 300px;padding: 6px 10px 5px;border: 1px solid #83ABCB;outline: none;"
                                   class="fillblankInput Wdate" value="{{isDefaultAnswer}}" disabled=""/>
                            {{else}}
                            {{#compare1 answerInputRow '1'}}
                            <input type="text" name="qu_{{quType}}_{{id}}" style="width:{{answerInputWidth}}px;"
                                   class="inputSytle_1 fillblankInput" value="{{isDefaultAnswer}}" disabled=""/>
                            {{else}}
                            <textarea name="qu_{{quType}}_{{id}}" rows="{{answerInputRow}}"
                                      style="width:{{answerInputWidth}}px;" class="inputSytle_2 fillblankInput"
                                      disabled="">{{isDefaultAnswer}}</textarea>
                            {{/compare1}}
                            {{/compare1}}
                            {{/if}}
                            <div class="dwComEditMenuBtn"></div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</script>

<!-- 9排序题orderby -->
<script type="text/x-handlebars-template" id="orderbyTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem quOrderByCoItem">
                <div class="quOrderByRight">
                    <table class="quOrderByTable" style="padding:5px;">
                        {{#each orderByTd}}
                        <tr class="quOrderByTableTr">
                            <td class="quOrderyTableTd">{{showIndex @index}}</td>
                            <td class="quOrderTabConnect"></td>
                        </tr>
                        {{/each}}
                    </table>
                </div>
                <div class="quOrderByLeft">
                    <ul class="quOrderByLeftUl">
                        {{#each orderByTd}}
                        <li class="quCoItemUlLi">
                            <label class="quCoOptionEdit">{{optionName}}
                                <input name="item_qu_{{quType}}_{{quId}}_{{id}}" value="1" type="hidden"
                                       class="quOrderItemHidInput">
                            </label>
                        </li>
                        {{/each}}
                    </ul>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
    </div>
</script>

<!-- 16分页pagetag -->
<script type="text/x-handlebars-template" id="pagetagTemplate">
    <div class="surveyQuItem">
        <div class="pageBorderTop nohover"></div>
        <div class="surveyQuItemContent" style="padding-top: 12px;height: 30px;min-height: 30px;">
            <a href="#" class="sbtn24 sbtn24_0 nextPage_a">下一页</a>&nbsp;&nbsp;
            {{#if pageNo}}
            {{#compare7 pageNo}}
            <a href="#" class="sbtn24 sbtn24_1 prevPage_a">上一页</a>
            {{else}}
            {{/compare7}}
            {{/if}}
            <input type="hidden" name="nextPageNo" value="{{pageNo}}">
        </div>
    </div>
</script>

<!-- 17段落paragraph -->
<script type="text/x-handlebars-template" id="paragraphTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent" style="min-height: 35px;">
            <div class="quCoTitle" style="background: rgb(243, 247, 247);">
                <div class="quCoTitleEdit" style="padding-left: 15px;">{{quTitle}}</div>
            </div>
        </div>
    </div>
</script>

<!-- 4多项填空题multi-fillblank -->
<script type="text/x-handlebars-template" id="multiFillblankTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <table class="mFillblankTable" cellpadding="0" cellspacing="0">
                    {{#each multifillblankTd}}
                    <tr class="mFillblankTableTr">
                        <td align="right" class="mFillblankTableEditTd">
                            <label class="quCoOptionEdit">{{optionName}}：</label>
                        </td>
                        <td>
                            <input name="text_qu_{{quType}}_{{quId}}_{{id}}" type="text"
                                   style="width:200px;padding:5px;" class="inputSytle_1 dwMFillblankInput"
                                   value="{{isDefaultAnswer}}" disabled=""/>
                        </td>
                    </tr>
                    {{/each}}
                </table>
            </div>
        </div>
    </div>
</script>

<!-- 11矩阵单选题chen-radio -->
<script type="text/x-handlebars-template" id="chenRadioTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <div class="quCoItemLeftChenTableDiv">
                    <table class="quCoChenTable">
                        <tr>
                            <td></td>
                            {{#each columnTd}}
                            <td class="quChenColumnTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{/each}}
                        </tr>
                        {{#each rowTd}}
                        <tr class="dwQuCoChenRowTr">
                            <td class="quChenRowTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{#each ../columnTd}}
                            <td>
                                <div class="dwQuOptionItemContent">
                                    <input type="radio" class="chenRadioInput" name="{{../id}}" disabled=""/>
                                </div>
                            </td>
                            {{/each}}
                        </tr>
                        {{/each}}
                    </table>
                </div>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</script>

<!-- 13矩阵多选题chen-checkbox -->
<script type="text/x-handlebars-template" id="chenCheckboxTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <div class="quCoItemLeftChenTableDiv">
                    <table class="quCoChenTable">
                        <tr>
                            <td></td>
                            {{#each columnTd}}
                            <td class="quChenColumnTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{/each}}
                        </tr>
                        {{#each rowTd}}
                        <tr class="dwQuCoChenRowTr">
                            <td class="quChenRowTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{#each ../columnTd}}
                            <td>
                                <div class="dwQuOptionItemContent">
                                    <input type="checkbox" class="chenCheckBoxInput" disabled=""/>
                                </div>
                            </td>
                            {{/each}}
                        </tr>
                        {{/each}}
                    </table>
                </div>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</script>

<!-- 12矩阵填空题chen-fbk -->
<script type="text/x-handlebars-template" id="chenFbkTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <div class="quCoItemLeftChenTableDiv">
                    <table class="quCoChenTable">
                        <tr>
                            <td></td>
                            {{#each columnTd}}
                            <td class="quChenColumnTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{/each}}
                        </tr>
                        {{#each rowTd}}
                        <tr class="dwQuCoChenRowTr">
                            <td class="quChenRowTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{#each ../columnTd}}
                            <td>
                                <div class="dwQuChenFbkOptionItemContent">
                                    <input name="fbk_item_qu_{{quType}}_{{quId}}_{{../id}}_{{id}}"
                                           class="inputSytle_1 dwChenMFillblankInput questionChenColumnValue"
                                           type="text" value="{{isDefaultAnswer}}" disabled=""/>
                                </div>
                            </td>
                            {{/each}}
                        </tr>
                        {{/each}}
                    </table>
                </div>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</script>

<!-- 18矩阵评分题chen-score -->
<script type="text/x-handlebars-template" id="chenScoreTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <div class="quCoItemLeftChenTableDiv">
                    <table class="quCoChenTable">
                        <tr>
                            <td></td>
                            {{#each columnTd}}
                            <td class="quChenColumnTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{/each}}
                        </tr>
                        {{#each rowTd}}
                        <tr class="dwQuCoChenRowTr">
                            <td class="quChenRowTd">
                                <label class="quCoOptionEdit">{{optionName}}</label>
                            </td>
                            {{#each ../columnTd}}
                            <td>
                                <div class="dwQuScoreOptionItemContent">
                                    <select name="cs_item_qu_{{quType}}_{{quId}}_{{../id}}_{{id}}"
                                            class="quChenScoreSelect" disabled="">
                                        <option value="0">-评分-</option>
                                        {{#scoreNum001 5}}{{/scoreNum001}}
                                    </select>
                                </div>
                            </td>
                            {{/each}}
                        </tr>
                        {{/each}}
                    </table>
                </div>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</script>

<!-- 8评分题score -->
<script type="text/x-handlebars-template" id="scoreTemplate">
    <div class="surveyQuItem">
        <div class="surveyQuItemContent">
            <div class="quCoTitle">
                <div class="quCoNum">{{showQuestionIndex quType}}、</div>
                <div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span>
                    <span class="quKnowledgeInfoList">知识点：{{countKnowledgePoints knowledgeIds}}个</span></div>
            </div>
            <div class="showOtherFile">

            </div>
            <div class="quCoItem">
                <table class="quCoItemTable" cellpadding="0" cellspacing="0">
                    {{#each scoreTd}}
                    <tr class="quScoreOptionTr">
                        <td class="quCoItemTableTd quOptionEditTd">
                            <label class="quCoOptionEdit">{{optionName}}</label>
                        </td>
                        <td class="quCoItemTableTd">
                            <table class="scoreNumTable" style="border-collapse: initial;">
                                <tr>
                                    {{#showParamInt02 ../paramInt02}}{{/showParamInt02}}
                                </tr>
                            </table>
                        </td>
                        <td class="quCoItemTableTd scoreNumText">分</td>
                    </tr>
                    {{/each}}
                </table>
            </div>
        </div>
    </div>
</script>

<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
    var quIndex = 0;//问题序号
    var pageNum = 1;//模拟页码
    var nowPageNum = 1;//当前页码

    layui.config({
        base: basePath,
        version: skyeyeVersion
    }).extend({
        window: 'js/winui.window',
    }).define(['window', 'jquery', 'winui', 'validate', 'table', 'weixinAudio'], function (exports) {
        winui.renderColor();
        layui.use(['form', 'jqueryUI'], function (form) {
            var $ = layui.$,
                form = layui.form,
                table = layui.table;

            showGrid({
                id: "wrap",
                url: schoolBasePath + "queryDirectoryById",
                params: {id: parent.rowId},
                pagination: false,
                template: getFileContent('tpl/examDetail/examPCDetail.tpl'),
                ajaxSendLoadBefore: function (hdb, json) {
                    json.total = 1;
                    hdb.registerHelper("showQuestionIndex", function (v1, options) {
                        if (v1 == '16' || v1 == '17') {
                        } else {
                            quIndex++;
                            return quIndex;
                        }
                    });

                    // 在Handlebars helper注册部分添加
                    hdb.registerHelper('eq', function (v1, v2, options) {
                        if (v1 == v2) {
                            return options.fn(this);
                        }
                        return options.inverse(this);
                    });

                    hdb.registerHelper("showIndex", function (v1, options) {
                        return parseInt(v1) + 1;
                    });

                    hdb.registerHelper("showParamInt02", function (v1, options) {
                        var str = "";
                        for (var i = 1; i <= v1; i++) {
                            str += "<td style='background-color: white;'>" + i + "</td>";
                        }
                        return str;
                    });

                    hdb.registerHelper('compare1', function (v1, v2, options) {
                        if (v1 == v2) {
                            return options.fn(this);
                        } else {
                            return options.inverse(this);
                        }
                    });

                    hdb.registerHelper('showQuestion', function (v1, i, options) {
                        switch (v1) {
                            case 1://1单选题radio
                                return new Handlebars.SafeString(getDataUseHandlebars($("#radioTemplate").html(), json.rows[i]));
                                break;
                            case 2://2多选题checkbox
                                return new Handlebars.SafeString(getDataUseHandlebars($("#checkBoxTemplate").html(), json.rows[i]));
                                break;
                            case 3://3填空题fillblank
                                return new Handlebars.SafeString(getDataUseHandlebars($("#fillblankTemplate").html(), json.rows[i]));
                                break;
                            case 4://4多项填空题multi-fillblank
                                return new Handlebars.SafeString(getDataUseHandlebars($("#multiFillblankTemplate").html(), json.rows[i]));
                                break;
                            case 8://8评分题score
                                return new Handlebars.SafeString(getDataUseHandlebars($("#scoreTemplate").html(), json.rows[i]));
                                break;
                            case 9://9排序题orderby
                                return new Handlebars.SafeString(getDataUseHandlebars($("#orderbyTemplate").html(), json.rows[i]));
                                break;
                            case 11://11矩阵单选题chen-radio
                                return new Handlebars.SafeString(getDataUseHandlebars($("#chenRadioTemplate").html(), json.rows[i]));
                                break;
                            case 12://12矩阵填空题chen-fbk
                                return new Handlebars.SafeString(getDataUseHandlebars($("#chenFbkTemplate").html(), json.rows[i]));
                                break;
                            case 13://13矩阵多选题chen-checkbox
                                return new Handlebars.SafeString(getDataUseHandlebars($("#chenCheckboxTemplate").html(), json.rows[i]));
                                break;
                            case 16://16分页pagetag
                                return new Handlebars.SafeString(getDataUseHandlebars($("#pagetagTemplate").html(), {
                                    ...json.rows[i],
                                    nowPageNum: nowPageNum,
                                    pageNo: pageNum
                                }));
                                break;
                            case 17://17段落paragraph
                                return new Handlebars.SafeString(getDataUseHandlebars($("#paragraphTemplate").html(), json.rows[i]));
                                break;
                            case 18://18矩阵评分题chen-score
                                return new Handlebars.SafeString(getDataUseHandlebars($("#chenScoreTemplate").html(), json.rows[i]));
                                break;
                        }
                    });

                    hdb.registerHelper('compare2', function (v1, v2, options) {
                        if (v1 == v2) {
                            return 'display: none;';
                        } else {
                            return '';
                        }
                    });

                    hdb.registerHelper('compare3', function (v1, v2, options) {
                        if (v1 > v2) {
                            return options.fn(this);
                        } else {
                            return options.inverse(this);
                        }
                    });

                    hdb.registerHelper('compare4', function (v1, options) {
                        if (v1 == nowPageNum) {
                            return '';
                        } else {
                            return 'display: none;';
                        }
                    });

                    hdb.registerHelper('compare5', function (v1, options) {
                        if (v1 == '16') {
                            if (pageNum == '1') {
                                pageNum++;
                                return '';
                            } else {
                                pageNum++;
                            }
                        }
                        if (pageNum == '1') {
                            return '';
                        } else {
                            return 'display: none;';
                        }
                    });

                    hdb.registerHelper('compare6', function (v1, options) {
                        return pageNum;
                    });

                    hdb.registerHelper('compare7', function (v1, options) {
                        if (nowPageNum == 1) {
                            return options.inverse(this);
                        } else {
                            return options.fn(this);
                        }
                    });

                    hdb.registerHelper('compare8', function (v1, v2) {
                        if (v1 == 3) {
                            //填空题
                            return '<input type="hidden" class="checkType" value="' + v2 + '">';
                        }
                        return "";
                    });

                    hdb.registerHelper('compare9', function (v1, v2, v3) {
                        if (v1 == 8) {
                            //评分题
                            return '<input type="hidden" class="geLe" value="' + v2 + '">'
                                + '<input type="hidden" class="scoreNum" value="' + v3 + '">';
                        }
                        return "";
                    });

                    hdb.registerHelper('compare10', function (v1, v2) {
                        if (v1 == 2) {
                            //多选题
                            return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="tag_qu_' + v1 + '_' + v2 + '_" />';
                        } else if (v1 == 9 || v1 == 11 || v1 == 13 || v1 == 12 || v1 == 18 || v1 == 8) {
                            //排序题，矩阵单选题，矩阵多选题，矩阵填空题，矩阵评分题，评分题
                            return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="item_qu_' + v1 + '_' + v2 + '_" />';
                        } else if (v1 == 4) {
                            //多项填空题
                            return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="text_qu_' + v1 + '_' + v2 + '_" />';
                        }
                        return "";
                    });

                    hdb.registerHelper("cellCount001", function (v1, options) {
                        var str = "";
                        var width = 600 / v1;
                        for (var i = 1; i <= v1; i++) {
                            str += '<td width="' + width + 'px">' +
                                '<div class="dwQuOptionItemContent">' +
                                '<label class="dwRedioStyle dwQuInputLabel" ></label>' +
                                '<input type="radio" name="qu_{{quType}}_{{quId}}" value="{{id}}" >' +
                                '<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
                                '<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_qu_{{quType}}_{{quId}}_{{id}}" />' +
                                '</div>' +
                                '</td>';
                        }
                        str += '<div class="emptyTd"></div>';
                        return str;
                    });

                    hdb.registerHelper("cellCount002", function (v1, options) {
                        var str = "";
                        var width = 600 / v1;
                        for (var i = 1; i <= v1; i++) {
                            str += '<td width="' + width + 'px">' +
                                '<div class="dwQuOptionItemContent">' +
                                '<label class="dwCheckboxStyle dwQuInputLabel" ></label>' +
                                '<input type="checkbox" name="tag_qu_{{quType}}_{{quId}}" value="{{id}}" >' +
                                '<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
                                '<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_tag_qu_{{quType}}_{{quId}}_{{id}}" />' +
                                '</div>' +
                                '</td>';
                        }
                        str += '<div class="emptyTd"></div>';
                        return str;
                    });

                    hdb.registerHelper("scoreNum001", function (v1, options) {
                        var str = "";
                        for (var i = 1; i <= v1; i++) {
                            str += '<option value="' + i + '">' + i + '分</option>';
                        }
                        return str;
                    });

                    // 添加计算知识点数量的辅助函数
                    hdb.registerHelper("countKnowledgePoints", function (knowledgeIds) {
                        if (!knowledgeIds) return 0;
                        return knowledgeIds.split(',').length;
                    });
                },
                ajaxSendAfter: function (json) {
                    $("#showForm").html(getDataUseHandlebars($("#examMationTemplate").html(), json.bean));
                    // 回显阅卷人
                    var str = "";
                    $.each(json.bean.readerMationList, function (i, row) {
                        str += row.userName + (row.userSex === 1 ? '(男)' : '(女)');
                    });
                    $("#markPeople").html(str);

                    // 加载题目逻辑
                    loadModel();
                    // 加载答卷人信息
                    initTable();

                    // 加载答案数据
                    loadAnswer(json);

                    form.render();
                }
            });

            /**
             * 加载答案
             */
            function loadAnswer(json) {
                $.each(json.rows, function (m, bean) {
                    // 1.加载答案
                    var qBodyItem = $("input[name='quId'][value='" + bean.id + "']").parents(".surveyQuItemBody");
                    var quType = bean.quTypeName;
                    loadShowOtherFile(qBodyItem, bean);
                    if (quType === "CHENCHECKBOX") {
                        var answer = qBodyItem.find(".quCoItem table.quCoChenTable tr input.chenCheckBoxInput");
                        var isDefaultAnswer = isJsonFormat(bean.isDefaultAnswer) ? JSON.parse(bean.isDefaultAnswer) : [];
                        var columuLength = qBodyItem.find(".quCoItem table.quCoChenTable tr td.quChenColumnTd").length;
                        var xIndex = 0;
                        var yIndex = 1;
                        $.each(answer, function (i) {
                            if (i % columuLength == 0) {
                                xIndex++;
                                yIndex = 1;
                            } else {
                                yIndex++;
                            }
                            var _this = this;
                            $.each(isDefaultAnswer, function (j, item) {
                                if (item.x == xIndex && item.y == yIndex) {
                                    $(_this).prop("checked", item.value);
                                }
                            });
                        });
                    } else if (quType === "CHENRADIO") {
                        var answer = qBodyItem.find(".quCoItem table.quCoChenTable tr input.chenRadioInput");
                        var isDefaultAnswer = isJsonFormat(bean.isDefaultAnswer) ? JSON.parse(bean.isDefaultAnswer) : [];
                        var columuLength = qBodyItem.find(".quCoItem table.quCoChenTable tr td.quChenColumnTd").length;
                        var xIndex = 0;
                        var yIndex = 1;
                        $.each(answer, function (i) {
                            if (i % columuLength == 0) {
                                xIndex++;
                                yIndex = 1;
                            } else {
                                yIndex++;
                            }
                            var _this = this;
                            $.each(isDefaultAnswer, function (j, item) {
                                if (item.x == xIndex && item.y == yIndex) {
                                    $(_this).prop("checked", item.value);
                                }
                            });
                        });
                    } else if (quType === "CHENSCORE") {
                        var answer = qBodyItem.find(".quCoItem table.quCoChenTable tr select.quChenScoreSelect");
                        var isDefaultAnswer = isJsonFormat(bean.isDefaultAnswer) ? JSON.parse(bean.isDefaultAnswer) : [];
                        var columuLength = qBodyItem.find(".quCoItem table.quCoChenTable tr td.quChenColumnTd").length;
                        var xIndex = 0;
                        var yIndex = 1;
                        $.each(answer, function (i) {
                            if (i % columuLength == 0) {
                                xIndex++;
                                yIndex = 1;
                            } else {
                                yIndex++;
                            }
                            var _this = this;
                            $.each(isDefaultAnswer, function (j, item) {
                                if (item.x == xIndex && item.y == yIndex) {
                                    $(_this).val(item.value);
                                }
                            });
                        });
                    } else if (quType === "CHENFBK") {
                        var answer = qBodyItem.find(".quCoItem table.quCoChenTable tr input.questionChenColumnValue");
                        var isDefaultAnswer = isJsonFormat(bean.isDefaultAnswer) ? JSON.parse(bean.isDefaultAnswer) : [];
                        var columuLength = qBodyItem.find(".quCoItem table.quCoChenTable tr td.quChenColumnTd").length;
                        var xIndex = 0;
                        var yIndex = 1;
                        $.each(answer, function (i) {
                            if (i % columuLength == 0) {
                                xIndex++;
                                yIndex = 1;
                            } else {
                                yIndex++;
                            }
                            var _this = this;
                            $.each(isDefaultAnswer, function (j, item) {
                                if (item.x == xIndex && item.y == yIndex) {
                                    $(_this).val(item.value);
                                }
                            });
                        });
                    }
                });
                form.render();
            }

            // 加载视频，音频，图片等
            function loadShowOtherFile(qBodyItem, bean) {
                var fileType = bean.fileType;
                var fileUrl = bean.fileUrl;
                var str = "";
                if (fileType == 1) {
                    // 视频
                    str = '<div><img src="../../assets/images/icon/icon-vedio.png" class="questionShowVedio" fileUrl="' + fileUrl + '"/></div>';
                } else if (fileType == 2) {
                    // 音频
                    str = '<div><img src="../../assets/images/icon/icon-audio.png" class="questionShowAudio" fileUrl="' + fileUrl + '" quTitle="' + bean.quTitle + '"/></div>';
                } else if (fileType == 3) {
                    // 图片
                    str = '<img src="' + fileUrl + '" class="questionShowImg" />';
                }
                qBodyItem.find(".showOtherFile").html(str);
            }

            // 试题相关视频点击
            $("body").on("click", ".questionShowVedio", function (e) {
                var url = $(this).attr("fileUrl");
                var loadstr = '<video width="100%" height="99%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">'
                    + '<source src="' + url + '" type="video/mp4"></source></video>';
                layer.open({
                    type: 1,
                    title: '播放视频',
                    area: ['70vw', '70vh'],
                    content: loadstr,
                    offset: 'auto'
                });
            });

            // 试题相关音频点击
            $("body").on("click", ".questionShowAudio", function (e) {
                var url = $(this).attr("fileUrl");
                var quTitle = $(this).attr("quTitle");
                var loadstr = '<p class="weixinAudio">'
                    + '<audio src="" id="media" width="1" height="1" preload></audio>'
                    + '<span id="audio_area" class="db audio_area">'
                    + '<span class="audio_wrp db">'
                    + '<span class="audio_play_area">'
                    + '<i class="icon_audio_default"></i>'
                    + '<i class="icon_audio_playing"></i>'
                    + '</span>'
                    + '<span id="audio_length" class="audio_length tips_global"></span>'
                    + '<span class="db audio_info_area">'
                    + '<strong class="db audio_title">' + quTitle + '</strong>'
                    + '<span class="audio_source tips_global">试题音频文件</span>'
                    + '</span>'
                    + '<span id="audio_progress" class="progress_bar" style="width: 0%;"></span>'
                    + '</span>'
                    + '</span>'
                    + '</p>';
                layer.open({
                    type: 1,
                    title: '播放音频',
                    area: ['70vw', '110px'],
                    content: loadstr,
                    offset: 'auto',
                    success: function (index) {
                        $('.weixinAudio').weixinAudio({
                            autoplay: false,
                            src: url
                        });
                    }
                });
            });

            // 试题相关图片点击
            $("body").on("click", ".questionShowImg", function (e) {
                var url = $(this).attr("src");
                showPicDisk([url]);
            });

            function initTable() {

                table.render({
                    id: 'messageTable',
                    elem: '#messageTable',
                    method: 'post',
                    url: schoolBasePath + 'querySurveyAnswerById',//根据试卷id查询答卷信息
                    where: {id: parent.rowId, field: '', order: ''},
                    even: false,
                    page: true,
                    limits: [40, 80, 120],
                    limit: 40,
                    cols: [[
                        {title: systemLanguage["com.skyeye.serialNumber"][languageType], rowspan: '2', type: 'numbers'},
                        {field: 'studentName', rowspan: '2', width: 80, title: '姓名', sort: true},
                        {field: 'studentNo', rowspan: '2', width: 140, align: 'center', title: '学号'},
                        {field: 'sessionYear', rowspan: '2', width: 80, align: 'center', title: '所属届'},
                        {field: 'schoolName', rowspan: '2', width: 150, title: '学校'},
                        {field: 'gradeName', rowspan: '2', width: 80, align: 'center', title: '年级'},
                        {
                            field: 'state',
                            rowspan: '2',
                            width: 80,
                            align: 'center',
                            title: '状态',
                            templet: function (d) {
                                if (d.state == 1) {
                                    return '待阅卷';
                                } else {
                                    return '已阅卷';
                                }
                            }
                        },
                        {title: '阅卷信息', align: 'center', colspan: '3'},
                        {title: '答题信息', align: 'center', colspan: '3'}
                    ], [
                        {field: 'markStartTime', title: '开始时间', align: 'center', width: 120},
                        {field: 'markEndTime', title: '结束时间', align: 'center', width: 120},
                        {field: 'markFraction', title: '最后得分', align: 'center', width: 100, sort: true},
                        {field: 'bgAnDate', title: '开始时间', align: 'center', width: 120},
                        {field: 'endAnDate', title: '结束时间', align: 'center', width: 120},
                        {field: 'totalTime', title: '耗时(分钟)', align: 'center', width: 100}
                    ]
                    ]
                });

                table.on('sort(messageTable)', function (obj) {
                    table.reloadData("messageTable", {
                        initSort: obj, where: {
                            field: obj.field,
                            order: obj.type
                        }
                    });
                });

                form.render();
            }

            //获取url中的参数
            function getUrlParam(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg); //匹配目标参数
                if (r != null) return unescape(r[2]);
                return null; //返回参数值
            }

            //分页设置 nextPage_a prevPage_a
            $("body").on("click", ".nextPage_a", function (e) {
                var thParent = $(this).parent();
                nowPageNum = nowPageNum + 1;
                updatePaginationButtons();
                $(".li_surveyQuItemBody").hide();
                $(".surveyQu_" + nowPageNum).fadeIn("slow");
                $("html,body").animate({
                    scrollTop: 10
                }, 500);
                return false;
            });
            $("body").on("click", ".prevPage_a", function (e) {
                var thParent = $(this).parent();
                nowPageNum = nowPageNum - 1;
                updatePaginationButtons();
                $(".li_surveyQuItemBody").hide();
                $(".surveyQu_" + nowPageNum).fadeIn("slow");
                $(window).scrollTop(10);
                return false;
            });

            // 更新分页按钮的函数
            function updatePaginationButtons() {
                var pageContainers = $(".surveyQuItemContent:has(.nextPage_a)");

                pageContainers.each(function () {
                    var prevBtn = $(this).find(".prevPage_a");

                    if (nowPageNum > 1) {
                        if (prevBtn.length === 0) {
                            $(this).append('<a href="#" class="sbtn24 sbtn24_1 prevPage_a">上一页</a>');
                        }
                    } else {
                        prevBtn.remove();
                    }
                });
            }

            function loadModel() {
                /******************************处理题目逻辑设置 **************************************/
                    //初始化 处理默认逻辑跳转为显示，则先隐藏元素
                var quLogics = $("#dwSurveyQuContent .quLogicItem");
                $.each(quLogics, function () {
                    var loginItem = $(this);
                    var cgQuItemId = loginItem.find(".cgQuItemId").val();
                    var skQuId = loginItem.find(".skQuId").val();
                    var logicId = loginItem.find(".logicId").val();
                    var logicType = loginItem.find(".logicType").val();
                    if (logicType === "2") {
                        //逻辑类型为"显示"2  则初始化为隐藏
                        var hidQuItemBody = $(".quId[value='" + skQuId + "']").parents(".li_surveyQuItemBody");
                        hidQuItemBody.hide();
                        hidQuItemBody.addClass("hidFor" + logicId);
                        hidQuItemBody.find(".answerTag").attr("disabled", true);
                    }
                });
            }

        });
    });

    // 注册 compare helper
    Handlebars.registerHelper('compare', function (v1, v2, options) {
        if (v1 === v2) {
            return options.fn(this);
        }
        return options.inverse(this);
    });

    // 添加自定义helper来处理班级信息的展示
    Handlebars.registerHelper('formatClassNames', function (classesMation) {
        if (!classesMation || !classesMation.length) return '';

        var name = [];
        for (var i = 0; i < classesMation.length; i++) {
            if (classesMation[i] && classesMation[i].name) {
                name.push(classesMation[i].name);
            }
        }
        return name.join('、');
    });
</script>
</body>

</html>